package cn.ilovese.collect.vo.report;

import cn.ilovese.collect.po.report.Report;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;

import java.util.Date;

@Data
@NoArgsConstructor
public class ReportWithWorkerNameVO {
    private Integer id;

    private String taskname;

    private Integer workerid;

    private String workername;

    private String type;

    private String environment;

    private String description;

    private String steps;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date submittime;

    private Double textSimilarity;

    private Double picSimilarity;

    private Boolean pass;

    public ReportWithWorkerNameVO(@NonNull Report report){
        id=report.getId();
        workerid = report.getUserId();
        description=report.getDescription();
        steps=report.getSteps();
        environment=report.getDeviceInfo();
        submittime = report.getSubmitTime();
        textSimilarity = report.getTextSimilarity();
        picSimilarity = report.getPicSimilarity();
        pass = report.getPass();
    }

    public ReportWithWorkerNameVO(@NonNull ReportVO reportVO,Integer workerId){
        id = reportVO.getId();
        taskname = reportVO.getTaskname();
        workerid = workerId;
        workername = reportVO.getWorkername();
        type = reportVO.getType();
        description = reportVO.getDescription();
        steps = reportVO.getSteps();
        environment = reportVO.getEnvironment();
        submittime = reportVO.getSubmittime();
        textSimilarity = reportVO.getTextSimilarity();
        picSimilarity  = reportVO.getPicSimilarity();
        pass = reportVO.getPass();
    }
}
